SftDirectory 2.5

Upgrading to Version 2.5

Softel vdm, Inc.

Converting an Existing Application

The conversion is not automatic.

Only a minimal conversion is required when upgrading from SftDirectory 2.0 to SftDirectory 2.5. SftDirectory 2.5 is virtually 100% source compatible with older releases of SftDirectory. Your application(s) must be recompiled to use SftDirectory 2.5.

SftDirectory 2.5 and older versions of SftDirectory can coexist on the same system (both can be installed and used at the same time) and they can be used in the same application.

Make sure to back up your current projects, before converting your projects.  Please read the conversion process specific to your language carefully BEFORE converting your project.
After converting, once the control saves updated property settings, you will not be able to return to SftDirectory 2.0.

Visual Basic
.NET (Managed Languages)
Visual C++ (Unmanaged C/C++)
Delphi
HTML
Other Development Tools

Visual Basic

After installing SftDirectory 2.5, all your projects will continue to use SftDirectory 2.0 until you make the following change in each project's main VBP (Visual Basic Project) file. Before opening the project file, make sure to close the project in Visual Basic, then edit the VBP file using a text editor and make the following changes:

Existing Project File (VPB File):

Type=Exe
Form=Form1.frm
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#G:\WINNT\System32\stdole2.tlb#OLE Automation
Object={CE77ECB0-51E1-478d-9D62-7DC9A39B8EB1}#2.0#0; SftDirectory_IX86_U_20.ocx
IconForm="Form1"
Startup="Form1"
ExeName32="yourexe.exe"
Command32=""
Name="yourproject"

The line describing SftDirectory 2.0 (above, using a bold font) should be replaced with the following:

Type=Exe
Form=Form1.frm
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#G:\WINNT\System32\stdole2.tlb#OLE Automation
Object={7C2EA0B0-31A4-431F-B315-3C6D57E5F394}#2.5#0; SftDirectory_IX86_U_25.ocx
IconForm="Form1"
Startup="Form1"
ExeName32="yourexe.exe"
Command32=""
Name="yourproject"

You can copy this line directly from this help file. The line must be copied as-is, without any modifications.

Existing Forms And Modules (FRM, BAS Files):

All forms and modules must be edited using a text editor.  The following changes can easily be accomplished by a global edit and replace operation:

All occurrences of "SftDirectoryLib20." must be replaced by "SftDirectoryLib25." (make sure to enter the trailing period for both strings).

Once the VBP file has been saved, you can open the project in Visual Basic and the project is now using SftDirectory 2.5. The controls will save updated property settings, so you will not be able to return to SftDirectory 2.0.

.NET (Managed Languages)

While most other languages offer a fairly easy conversion, .NET and its languages require a bit more effort, but in most cases is limited to the steps documented below.

Existing Forms (FRM Files):

Updating the forms to use SftDirectory 2.5 is quite straightforward:

The forms can now be opened and the project uses SftDirectory 2.5 exclusively.  You will not be able to return to SftDirectory 2.0.

Visual C++ (Unmanaged C/C++)

Resource Files

After installing SftDirectory 2.5, all your projects will continue to use SftDirectory 2.0 until you make the following change in each dialog resource that defines a SftDirectory control. Before opening the resource script (RC file), make sure to close the project in Visual C++, then edit the RC file using a text editor and make the following changes:

IDD_MFC_DIALOG DIALOGEX 0, 0, 320, 200
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "MFC"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,260,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,260,23,50,14
    CONTROL         "",IDC_SFTDIRECTORY1, "{CE77ECB4-51E1-478D-9D62-7DC9A39B8EB1}",
                      WS_TABSTOP,7,26,364,180
END

The contents of the line describing SftDirectory 2.0 (above, using a bold font) should be replaced with the following line:

    CONTROL         "",IDC_SFTDIRECTORY1, "{7C2EA0B4-31A4-431F-B315-3C6D57E5F394}",

Only change the ClassID (i.e., {CE77ECB4-51E1-478D-9D62-7DC9A39B8EB1} to {7C2EA0B4-51E1-478D-9D62-7DC9A39B8EB1}), do not change the rest of the line.

You can copy this information directly from this help file. The ClassID must be copied as-is, without any modifications.

Make sure to change ALL occurrences of SftDirectory to version 2.5, otherwise you will not be able to open the resource script (RC file).

Once the RC file has been saved, you can open the project in Visual C++ and the project is now using SftDirectory 2.5. The controls will save updated property settings, so you will not be able to return to SftDirectory 2.0.

#import Statements

Any #import statements that are used in your application must now use the new control:

#pragma warning(disable : 4192)   // automatically excluding 'Ixxx' 
                                  // while importing type library
#import <SftDirectory_IX86_U_20.ocx> rename_namespace("SftDirectoryNameSpace") \
         exclude("_STRRET") exclude("UINT_PTR") exclude("tagOleMenuGroupWidths") \
         exclude("FOLDERSETTINGS") exclude("IShellFolder") exclude("IEnumIDList") \
         exclude("IShellView") exclude("IShellBrowser")
#pragma warning(default : 4192)  
using namespace SftDirectoryNameSpace;

should be replaced with

#pragma warning(disable : 4192)   // automatically excluding 'Ixxx' 
                                  // while importing type library
#import <SftDirectory_IX86_U_25.ocx> rename_namespace("SftDirectoryNameSpace") \
         exclude("_STRRET") exclude("UINT_PTR") exclude("tagOleMenuGroupWidths") \
         exclude("FOLDERSETTINGS") exclude("IShellFolder") exclude("IEnumIDList") \
         exclude("IShellView") exclude("IShellBrowser")
#if _MSC_VER >= 1400 // need at least Visual Studio 2005
# pragma comment(lib, "comsuppw.lib") // avoid link error in VS2005
#endif
#pragma warning(default : 4192)
using namespace SftDirectoryNameSpace;

Delphi

Once SftDirectory 2.5 has been installed and added to the Component Palette as described in Using SftDirectory with Delphi, all projects have access to SftDirectory 2.5.

If the same class (TSftDirectory) was used to add SftDirectory 2.5 to the Component Palette, all projects will automatically use the new version. Otherwise, you will have to manually change each project to use the new defined class name instead of TSftDirectory.

HTML

After installing SftDirectory 2.5, all your HTML pages will continue to use SftDirectory 2.0 until you make the following change in each page that uses a SftDirectory control.

<OBJECT id="SftDirectory1" width="275" height="179" 
   CLASSID="clsid:CE77ECD2-51E1-478d-9D62-7DC9A39B8EB1" codebase="SftDirectory_IX86_I_20.cab#version=2,0,0,0">
    <param name="PropVer" value="20">
    <param name="PropFile" value>
    <param name="PropDesignTime" value="1">

The contents of the line describing SftDirectory 2.0 (above, using a bold font) should be replaced with the following:

   CLASSID="CLSID:7C2EA0D2-31A4-431F-B315-3C6D57E5F394" CODEBASE="SftDirectory_IX86_I_25.cab#version=2,5,0,0">

The CODEBASE argument also needs to be updated to reflect the new cabinet name and the current version number.

Once the page has been saved, you can open the web page using your preferred HTML editor.  The controls will save updated property settings, so you will not be able to return to SftDirectory 2.5.

Other Development Tools

Most development tools allow access to the ClassID used for controls on a form or dialog. Sometimes this may be accomplished by using a text editor and editing a configuration file, or possibly the development tool allows direct modification of the ClassID.

Generally, the ClassID used for the prior release {B67663B0-30BB-400E-8070-D0A4CD7E2DE9} must be replaced with the new ClassID {7C2EA0B0-31A4-431F-B315-3C6D57E5F394}. Once this step is completed, opening the project is sufficient to allow SftDirectory to convert the stored property settings.

For specific instructions or help, please see your development tool's documentation.


Feedback / comments / error reports for this topic
© 2003, 2008 - Softel vdm, Inc. - www.softelvdm.com